/**
 * @Description: 用Object保存坐标类信息
 * @Author Stark
 * @Date 2022/3/27 16:43
 **/
public class Point {
    private Object x;
    private Object y;

    public Object getX() {
        return x;
    }

    public Object getY() {
        return y;
    }

    public void setX(Object x) {
        this.x = x;
    }

    public void setY(Object y) {
        this.y = y;
    }

    public static void main(String[] args) {
        Point point = new Point();
        //自动装箱
        point.setX(10.1);
        point.setY(5.5);
        //自动拆箱
        double x = (double) point.getX();
        double y = (double) point.getY();
        System.out.println("x = " + x + ",y = " + y);

        Point point1 = new Point();
        point1.setX(10.1);
        point1.setY("北纬55度");
        String x1 = (String) point1.getX();
        String y1 = (String) point1.getY();
        System.out.println("x = " + x1 + ",y = " + y1);
    }
}
